Import library and connect
In [1]:
from scidbpy import connect
sdb = connect('http://localhost:8080')
Check how many arrays are in SciDB
In [2]:
lenght = len(dir(sdb.arrays))
lenght
Out[2]:
Get a random arrayName
In [3]:
from random import randint
arrayName = dir(sdb.arrays)[randint(0, lenght)]
arrayName
Out[3]:
get the array from SciDB
In [4]:
myArray = sdb.iquery('scan('+arrayName+')', fetch=True, as_dataframe=True)
Plot the x value of the array
In [5]:
import matplotlib.pyplot as plt
simpleArray = myArray["x"];
simpleArray.plot()
plt.show()
List the array
In [6]:
simpleArray
Out[6]:
In [ ]: